package org2.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class MyMethodInterceptor implements MethodInterceptor {

    @Override
    public Object intercept(Object obj, Method method, Object[] args, MethodProxy proxy) throws Throwable {
        System.out.println("Before method:"+method.getName());
        Object retValue = methodProy.invokSuper(target,objects);
        System.out.println("After method:"+method.getName());
        return retValue;
    }
}
